import cv2

WINDOW_NAME = '0'

cv2.namedWindow(WINDOW_NAME)

linux = cv2.imread('../images/LinuxLogo.jpg')
windows = cv2.imread('../images/WindowsLogo.jpg')

def onAlphaChange(val):
    alpha = val / 100
    img = cv2.addWeighted(
        linux, alpha,
        windows, 1 - alpha,
        0
    )
    cv2.imshow(WINDOW_NAME, img)

trackbar = cv2.createTrackbar('alpha', WINDOW_NAME, 50, 100, onAlphaChange)
onAlphaChange(50)

cv2.waitKey(0)